﻿using Common.Contract.Authentication.Record;
using SMEsCustomer360Degree.Controllers.core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace SMEsCustomer360Degree.Controllers
{
    public class SystemController : ControllerBase
    {
        #region Menu & Header
        //[Authorize]
        [ChildActionOnly]
        public ActionResult HeaderMenu()
        {
            return PartialView("_HeaderMenu", this.MenuNodes);
        }

        //[Authorize]
        [ChildActionOnly]
        public ActionResult Sidebar()
        {
            UserRecord userRecord = this.CurrentUserRecord;
            return PartialView("_Sidebar", userRecord);
        }

        [ChildActionOnly]
        public ActionResult SubMenuCustomer()
        {
            return PartialView("_SubMenuCustomer");
        }
        #endregion

        #region Multi Lang
        public ActionResult ChangeLanguage(string lang)
        {
            new SiteLanguages().SetLanguage(lang);
            return Redirect(Request.UrlReferrer.ToString());
        }
        #endregion
    }
}
